package com.ocean.system.service.impl;

import com.ocean.common.core.text.Convert;
import com.ocean.common.utils.uuid.IdUtils;
import com.ocean.system.domain.ONotice;
import com.ocean.system.mapper.ONoticeMapper;
import com.ocean.system.service.IONoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author msy
 * @date 2024/2/2
 */
@Service
public class ONoticeServiceImpl implements IONoticeService {

    @Autowired
    private ONoticeMapper noticeMapper;

    @Override
    public ONotice selectNoticeById(String id) {
        return noticeMapper.selectNoticeById(id);
    }

    @Override
    public List<ONotice> selectONoticeList(ONotice notice) {
        return noticeMapper.selectONoticeList(notice);
    }

    @Override
    public int insertNotice(ONotice notice) {
        notice.setId(IdUtils.simpleUUID());notice.setStatus("0");
        return noticeMapper.insertNotice(notice);
    }

    @Override
    public int updateNotice(ONotice notice) {
        return noticeMapper.updateNotice(notice);
    }

    @Override
    public int deleteNoticeByIds(String ids) {
        return noticeMapper.deleteNoticeByIds(Convert.toStrArray(ids));
    }
}
